import java.rmi.RemoteException;

import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JList;

import rmi.Me;
import rmi.UserBuffer;

/**
 * @author arthur
 * 
 */
public class test {

	/**
	 * @param args
	 * @throws RemoteException
	 */
	public static void main(final String[] args) throws RemoteException {
		final JFrame jf = new JFrame();
		final JList jl = new JList();

		final Me me = new Me("test", "test", 1099);
		me.getFriends().put("kikoo", new UserBuffer("kikoo", "kikoo", 1234));
		me.getFriends().put("kikoo2", new UserBuffer("kikoo2", "kikoo2", 1234));

		final DefaultListModel dml = new DefaultListModel();
		jl.setModel(dml);

		for (final UserBuffer u : me.getFriends().values()) {
			dml.addElement(u);
		}

		jf.setSize(300, 300);
		jf.add(jl);

		jf.setVisible(true);

		me.getFriends().put("kikoo3", new UserBuffer("kikoo3", "kikoo3", 1234));

		dml.clear();
		for (final UserBuffer u : me.getFriends().values()) {
			dml.addElement(u);
		}

		System.out.println("kikoo");

	}

}
